﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ATM
{
    public partial class deleteUser : Form
    {
        public deleteUser()
        {
            InitializeComponent();
        }

        private void deleteUser_Load(object sender, EventArgs e)
        {

        }

        private void back_Click(object sender, EventArgs e)
        {
            adminMainPanel ampForm = new adminMainPanel();
            this.Hide();
            ampForm.Show();

        }

        private void exit_Click(object sender, EventArgs e)
        {
            welcom wForm = new welcom();
            this.Hide();
            wForm.Show();
        }

        private void deleteUserBut_Click(object sender, EventArgs e)
        {
            int id = int.Parse(userId.Text);
            adminLogic al = new adminLogic();
            if (userId.Text != "")
            {
                if (al.deleteUser(id))
                    MessageBox.Show("done");
                else
                    MessageBox.Show("failed");
            }
            else
                MessageBox.Show("user id can not be empty!");
        }
    }
}
